package com.wlh.animation.demo;

import com.wlh.animation.R;
import com.wlh.animation.vector.LineVectorAnimationAct;

import android.app.Activity;
import android.app.LauncherActivity;
import android.app.ListActivity;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

/**
 * Created by weilh on 2016/1/26.
 */
public class BaseDemoListAct extends AppCompatActivity {
    private ListView list;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base_demo_list);
        setTitle("动画特效");
        list = (ListView) findViewById(R.id.list);
        list.setAdapter(new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1, new String[] {"灵动菜单",
                "滑动特效1", "滑动特效2", "吸顶效果", "矩形变圆形", "最大显示个数的ListView", "底部滑出的PopWindow",
                "列表Item特效1"}
        ));
        list.setOnItemClickListener(new AdapterView.OnItemClickListener() {
            @Override
            public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
                switch (position) {
                    case 0:
                        startActivity(new Intent(BaseDemoListAct.this, LineVectorAnimationAct.class));
                        break;
                    case 1:
                        startActivity(new Intent(BaseDemoListAct.this, SlideAnimAct1.class));
                        break;
                    case 2:
                        toAct(SlideAnimAct2.class);
                        break;
                    case 3:
                        toAct(SlideAnimAct3.class);
                        break;
                    case 4:
                        startActivity(new Intent(BaseDemoListAct.this, RectToCircleAct.class));
                        break;
                    case 5:
                        toAct(MaxItemListViewAct.class);
                        break;
                    case 6:
                        toAct(BottomPopListWindowAct.class);
                        break;
                    case 7:
                        toAct(ListItemAnimAct1.class);
                        break;
                }
            }
        });
    }

    private void toAct(Class<? extends Activity> activityCls) {
        startActivity(new Intent(this, activityCls));
    }
}
